﻿using Common.CommonModel;
using Microsoft.AspNetCore.Http;
using Newtonsoft.Json.Linq;
using Services.Base;
using SqlSugarAndEntity.DataTransferObject.Test;
using SqlSugarAndEntity.Entity;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace Services.User
{
    public interface IUserService:IBaseService<sys_userinfo>
    {
        ResponseModel ImportUserinfo(Stream s);
        string ExportUserinfo(string Name, string UserAccount, string UserPhone, string IdNumber, string OrgName);
        /// <summary>
        /// 用户登录
        /// </summary>
        /// <param name="account"></param>
        /// <param name="password"></param>
        /// <returns></returns>
        ResponseModel Login(string account, string password);
        /// <summary>
        /// 刷新token
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        ResponseModel RefreshToken(JObject value);
        /// <summary>
        /// 获取用户信息
        /// </summary>
        /// <param name="Name"></param>
        /// <param name="UserAccount"></param>
        /// <param name="UserPhone"></param>
        /// <param name="IdNumber"></param>
        /// <param name="OrgName"></param>
        /// <param name="page"></param>
        /// <param name="limit"></param>
        /// <returns></returns>
        ResponseModel GetUserInfo(string Name, string UserAccount, string UserPhone, string IdNumber, string OrgName,int page,int limit);
        /// <summary>
        /// 新建用户信息
        /// </summary>
        /// <param name="user"></param>
        /// <param name="map"></param>
        /// <returns></returns>
        ResponseModel CreateUserInfo(sys_userinfo user,List<sys_usermaporg> map);
        /// <summary>
        /// 更新用户信息
        /// </summary>
        /// <param name="user"></param>
        /// <param name="map"></param>
        /// <returns></returns>
        ResponseModel UpdateUserInfo(sys_userinfo user, List<sys_usermaporg> map);
        /// <summary>
        /// 密码修改
        /// </summary>
        /// <param name="pwd"></param>
        /// <returns></returns>
        ResponseModel UpdateUserPwd(decimal UserId, string OldPwd, string NewPwd);
        /// <summary>
        /// 删除用户信息
        /// </summary>
        /// <param name="UserExp"></param>
        /// <param name="MapExp"></param>
        /// <returns></returns>
        ResponseModel DeleteUserInfo(Expression<Func<sys_userinfo,bool>> UserExp, Expression<Func<sys_usermaporg, bool>> MapExp);
        /// <summary>
        /// 根据角色ID获取已经授权的用户信息
        /// </summary>
        /// <param name="roleId"></param>
        /// <param name="page"></param>
        /// <param name="limit"></param>
        /// <returns></returns>
        ResponseModel GetRoleAuthorized(decimal roleId, int page, int limit);
        /// <summary>
        /// 根据角色ID获取未被授权的角色信息
        /// </summary>
        /// <param name="roleId"></param>
        /// <param name="page"></param>
        /// <param name="limit"></param>
        /// <returns></returns>
        ResponseModel GetRoleNotAuthorized(decimal roleId, int page, int limit);

        Task<int> TestAsync(int num);
        Task<sys_userinfo> TestClassAsync();
        int Test();
        sys_userinfo TestClass();

        int TestProxy(TestProxy testProxy);
    }
}
